package com.xuecheng.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.model.dto.TeachplanDto;
import com.xuecheng.content.model.po.Teachplan;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 课程计划 Mapper 接口
 * </p>
 *
 * @author itcast
 */
public interface TeachplanMapper extends BaseMapper<Teachplan> {
    /**
     * 根据课程id查询课程计划列表
     * @param courseId 课程id
     * @return List<TeachplanDto>
     */
    public List<TeachplanDto> selectTreeNodes(long courseId);

    /**
     * 根据课程id查询比当前Teachplan 的排序字段大的一条数据
     * @param grade
     * @param courseId
     * @param orderby
     * @return
     */
    public Teachplan movedownTeachplan(@Param("grade") Integer grade,@Param("courseId") Long courseId,
                                       @Param("orderby") Integer orderby,@Param("parentid") Long parentid);
}
